<template>
	<!-- 我的 -->
	<view class="content">
		
		<view class="header">
			<!-- 设置 -->
			<view class="setting" @click="goSetting">
				<view>
					<i-icon icon="iconshezhi" color="#FFFFFF" size="46rpx"></i-icon>
				</view>
			</view>

			<!-- 用户信息 -->
			<view class="user flex">

				<!-- 头像 -->
				<view class="user-headImg" @click="goInfo">
					<image :src="shareInfo.headPortrait" mode="aspectFill" v-if="shareInfo.headPortrait"></image>
					<i-icon v-else icon="headImg3" size="130rpx" type="multiple"></i-icon>
					<!-- <image src="https://files.yzsheng.com/AccountDefaultImg/HeadPortrait.png" v-else mode="aspectFit"></image> -->
				</view>

				<!-- 用户名等 -->
				<view class="user-content" v-if="id && JSON.stringify(shareInfo) !== '{}'">
					<view class="user-content-left flex">
						<view class="user-content-left-name" @click="goInfo">{{shareInfo.name}}</view>
						<view class="user-content-left-img" v-if="shareInfo.account_Type === 1"><!-- 亮 -->
							<image src="https://files.yzsheng.com/client/order/hehuorenicon.png"></image>
						</view>
						<view class="user-content-left-img" v-if="shareInfo.account_Type === 0">
							<image src="https://files.yzsheng.com/client/me/img/hehuoren2.png"></image>
						</view>
						<view class="user-content-left-img" v-if="shareInfo.account_Type === 2">
							<i-icon icon="iconhuangguan" type="multiple" size="42rpx"></i-icon>
						</view>
						<view class="user-content-left-img">
							<image src="https://files.yzsheng.com/client/order/chebiao.png"></image>
						</view>
						<view class="user-content-right" @click="goInfo">
							<view class="flex flex-ai-c">
								<view class="user-content-right-code flex">
									<i-icon icon="iconerweima" size="48rpx" color="#FFFFFF"></i-icon>
								</view>
								<view>
									<u-icon name="arrow-right" color="#999999" size="30"></u-icon>
								</view>
							</view>

						</view>
					</view>

					<!-- 二维码放大 -->
					<!-- <u-modal :mask-close-able="true" v-model="show" :show-title="false" :show-cancel-button="false"
					 :show-confirm-button="false">
						<view>
							<image :src="perList.app_QR_code" mode="aspectFit" style="width: 600rpx;height: 600rpx;"></image>
						</view>
					</u-modal> -->

					<!-- 进度 -->
					<view v-if="shareInfo.account_Type === 0">
						<view class="list">
							<view class="botline">
								<view class="topline" :style="{width:percent + '%'}"></view>
								<view class="left"></view>
								<view class="right" :style="{left:percent + '%'}"></view>
							</view>
							<view class="number">
								<view class="line">
									<view class="line-s"></view>
								</view>
								<view class="line">
									<view class="line-num">25</view>
								</view>
							</view>
						</view>
						<view class="people">
							<text>{{percent/4}}/25</text>
							<text>
								还需邀请{{25-percent/4}}位好友成为
							</text>
							 
							<text @click="goPage('/pages_common/pages_me/strategy/strategy')" v-if="!isIOS">【合伙人】</text>
							<text v-else>【合伙人】</text>
						</view>
					</view>
					<view v-else-if="shareInfo.account_Type!==0 && shareInfo.Company_Name" class="list" style="color: #FFFFFF;font-size: 24rpx;font-weight: 500;">
						{{shareInfo.Company_Name}}
					</view>
				</view>

				<view class="user-content flex flex-ai-c" v-else style="color: #FFFFFF;" @click="login">
					<view style="font-size: 40rpx;">登录/注册</view>
				</view>
			</view>
		</view>

		<view class="main">

			<!-- 菜单导航 -->
			<view class="nav">
				<view class=" flex flex-jc-sa flex-ai-c card">
					<view class="nav1" @click="goPage('/pages_userModule/myFavorites/myFavorites')">
						<view v-if="shareInfo.favorites">{{shareInfo.favorites}}</view>
						<view v-else>0</view>
						<view>收藏夹</view>
					</view>
					<view class="nav1" @click="goPage('/pages_userModule/myCoupon/index')">
						<view v-if="shareInfo.coupon">{{shareInfo.coupon}}</view>
						<view v-else>0</view>
						<view>优惠券</view>
					</view>
					<view class="nav1" @click="goPage('/pages_userModule/myBrowsingHistory/myBrowsingHistory')">
						<view>{{visitCount}}</view>
						<view>我的浏览</view>
					</view>
				</view>

			</view>

			<!-- 我的订单 -->
			<view class="order">
				<view class="order-title flex flex-jc-sb">
					<view class="flex flex-ai-c">
						<view class="line"></view>
						<view class="order-title-name">我的订单</view>
					</view>
					<!-- 左边 -->
					<view class="flex flex-ai-c">
						<view class="look" @click="goPage('/pages_order/buy_order/buy_order')">查看全部</view>
						<view>
							<u-icon name="arrow-right" color="#989898" size="15"></u-icon>
						</view>
					</view>
				</view>

				<!-- 图标 -->
				<view class="icons flex flex-jc-sb">

					<view v-for="(item,index) in typeMenu" :key='index' @click="goPage(item.path)">
						<view>
							<i-icon :icon='item.imgSrc' type="multiple" size="80rpx"></i-icon>
						</view>
						<view class="icons-text">{{item.text}}</view>
					</view>
				</view>
			</view>

			<!-- 我的推广订单 -->
			<view class="extension" v-if="shareInfo.account_Type===2">
				<view class="order">
					<view class="order-title flex flex-jc-sb">
						<view class="flex flex-ai-c">
							<view class="line"></view>
							<view class="order-title-name">我的推广订单</view>
						</view>
						<!-- 左边 -->
						<view class="flex flex-ai-c" @click="goPage('/pages_order/promotion_order/promotion_order')">
							<view class="look">查看全部</view>
							<view>
								<u-icon name="arrow-right" color="#989898" size="15"></u-icon>
							</view>
						</view>
					</view>

					<!-- 图标 -->
					<view class="icons flex flex-jc-sb">
						<view v-for="(item,index) in extension" :key='index' @click="goOrder(item.id)">
							<view>
								<i-icon :icon='item.imgSrc' type="multiple" size="56rpx"></i-icon>
								<!-- <image :src="item.imgSrc" style="width: 56rpx;height: 56rpx;"></image> -->
							</view>
							<view class="icons-text">{{item.text}}</view>
						</view>
					</view>
				</view>
			</view>

			<view v-if="shareInfo.account_Type===2">
				<view class="order">
					<view class="order-title flex flex-jc-sb">
						<view class="flex flex-ai-c">
							<view class="line"></view>
							<view class="order-title-name">我的好友</view>
						</view>
						<!-- 左边 -->
						<view class="flex flex-ai-c" @click="goFriends">
							<view class="look">查看全部</view>
							<view>
								<u-icon name="arrow-right" color="#989898" size="15"></u-icon>
							</view>
						</view>
					</view>

					<!-- 图标 -->
					<view class="icons flex flex-jc-sb">
						<view>
							<view><text style="color: #FF9813;font-weight: bold;font-size: 50rpx;">{{shareInfo.share}}</text>人</view>
							<view>我邀请的</view>
						</view>
						<view>
							<view><text style="color: #FF9813;font-weight: bold;font-size: 50rpx;">{{perList.allInvited}}</text>人</view>
							<view>所有邀请</view>
						</view>
						<view>
							<view><text style="color: #FF9813;font-weight: bold;font-size: 50rpx;">{{perList.todayInvited}}</text>人</view>
							<view>今日增加</view>
						</view>
					</view>
				</view>
			</view>

			<!-- 我的收益 -->
			<view class="profit">
				<view class="order">
					<view class="order-title flex flex-jc-sb">
						<view class="flex flex-ai-c">
							<view class="line"></view>
							<view class="order-title-name">我的余额</view>
						</view>
						<!-- 左边 -->
						<view class="flex flex-ai-c" @click="goPage('/pages_userModule/incomeExpenditur/incomeExpenditur')">
							<view class="look">收益详情</view>
							<view>
								<u-icon name="arrow-right" color="#989898" size="15"></u-icon>
							</view>
						</view>
					</view>

					<!-- 图标 -->
					<view class="icons" @click="goPage('/pages_userModule/my_earnings/my_earnings?rz='+isRz)">
						<view class="total">
							<view class="total-price" v-if="shareInfo.inMoney">{{shareInfo.inMoney}}</view>
							<view class="total-price" v-else>0</view>
							<view class="total-text">总资产（元）</view>
						</view>
					</view>
				</view>
			</view>

			<!-- 推广营销 -->
			<view class="marketing" v-if="shareInfo.account_Type===2">
				<view class="order">
					<view class="order-title flex flex-jc-sb">
						<view class="flex flex-ai-c">
							<view class="line"></view>
							<view class="order-title-name">营销推广</view>
						</view>
					</view>

					<!-- 图标 -->
					<view class="icons flex flex-jc-sb" v-if="shareInfo.account_Type===2">
						<view class="share" @click="goPage('/pages_common/pages_me/invitation/invitation?type=push')">
							<image src="https://files.yzsheng.com/client/me/setting/fenxiang.png" style="width: 310rpx;height: 248rpx;position: absolute;top: 0;right: 0;"></image>
							<view>分享邀请送福利</view>
							<view>赚佣金</view>
						</view>
            
            <!-- 点击跳转到分享海报列表页面 -->
						<view class="share" @click="goPostersPage()">
							<image src="https://files.yzsheng.com/client/me/setting/haibao.png" style="width: 310rpx;height: 248rpx;position: absolute;top: 0;right: 0;"></image>
							<view>创意海报DIY</view>
							<view>赚佣金</view>
						</view>
					</view>
				</view>
			</view>

			<!-- 邀请好友 -->
			<view v-if="shareInfo.account_Type !==2&&!isIOS" class="flex flex-jc-c" style="padding:20rpx 0 20rpx 0" @click="goPage('/pages_common/pages_me/invitation/invitation')">
				<image style="width: 670rpx;height: 203rpx;" src="https://files.yzsheng.com/client/me/img/hehuorenbanner.png"></image>
			</view>

			<!-- 合伙人 -->
			<view class="partner" v-if="shareInfo.account_Type !== 2">
				<view class="order">
					<view class="order-title flex flex-jc-sb">
						<view class="flex flex-ai-c">
							<view class="line"></view>
							<view class="order-title-name">77合伙人</view>
						</view>
						<!-- 左边 -->
						<view class="flex flex-ai-c">
							<!-- <view class="look" @click="goPage('/pages_common/pages_me/strategy/strategy')">了解详情</view> -->
							<view v-if='!isIOS' @click="goPage('/pages_common/pages_me/partner/partner')">
								<u-icon name="arrow-right" color="#989898" size="15"></u-icon>
							</view>
						</view>
					</view>

					<!-- 海报招募 -->
					<view class="poster" style="padding-bottom: 30rpx;">
						<view class="flex flex-jc-sa">
							<view v-for="(item,index) in partner" :key='index' @click="goPartner(item.path,item.id)">
								<view class="image1">
									<image :src="item.imgSrc"></image>
								</view>
								<view>{{item.text}}</view>
							</view>
						</view>
						<view v-if="!isIOS" class="image2 flex flex-jc-c" @click="goPage('/pages_common/pages_me/partner/partner')">
							<image src="https://files.yzsheng.com/client/me/img/zhaomubanner.png"></image>
						</view>
					</view>
				</view>
			</view>
			<!-- 海报 -->
			<view class="fws-img" v-if="shareInfo.account_Type===2 && !isIOS" @click="goPage('/pages_common/pages_me/partner/partner')">
				<image src="https://files.yzsheng.com/client/me/img/zhaomubanner.png"></image>
			</view>

			<!-- 我的车单 -->
			<view class="footer flex">
				<view class="footer-btn1" @click="goPage('/pages_commodity/womyCarList/womyCarList')">
					<image src="https://files.yzsheng.com/client/index/carMaintenance/chedan.png" style="width: 150rpx;height: 150rpx;position: absolute;bottom: 20rpx;right: 0;"></image>
					<view class="flex flex-ai-c">
						<view class="line"></view>
						<view>我的车单</view>
					</view>
					<view class="footer-content">
						<view class="footer-main">添加想买的车型</view>
						<view class="footer-main">我们助你实现</view>
						<view style="color: #999999;font-size: 26rpx;">已有3700万用户添加</view>
					</view>
					<view class="flex footer-btn flex-jc-c flex-ai-c">
						<view class="flex">
							<i-icon icon="icontianjia"></i-icon>
						</view>
						<view>添加车单</view>
					</view>
				</view>
				<view class="footer-btn1" style="margin-left: 25rpx;" @click="goPage('/pages_commodity/myLoveCar/myLoveCar?type=110')">
					<image src="https://files.yzsheng.com/client/index/carMaintenance/aiche.png" style="width: 200rpx;height: 100rpx;position: absolute;bottom: 120rpx;right: 0;"></image>
					<view class="flex flex-ai-c flex-jc-sb">
						<view class="flex flex-ai-c">
							<view class="line"></view>
							<view>我的爱车</view>
						</view>
						
						<view class="carNum flex flex-jc-c flex-ai-c">
							<view>
								<!-- {{this.$store.state.carNum}} -->
								{{shareInfo.myCarCount|| 0}}
								辆爱车
							</view>
							<view><i-icon icon='iconarrow-right' size='20rpx'></i-icon></view>
						</view>
					</view>
					<view class="footer-content">
						<view class="footer-main">无忧养车超多福利</view>
						<view style="color: #999999;font-size: 26rpx;">车主享洗车养车福利</view>
					</view>

					<view class="flex footer-btn flex-jc-c flex-ai-c">
						<view class="flex">
							<i-icon icon="icontianjia"></i-icon>
						</view>
						<view>添加爱车</view>
					</view>
				</view>
			</view>
		</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script src="./me.js"></script>

<style lang="scss" scoped>
	.carNum{
		background-color: #686f9f;
		color: #fff;
		font-size: 20rpx;
		border-radius: 20rpx;
		width: 130rpx;
		height: 36rpx;
	}
	@import './me.scss';
</style>
